import React, {Component} from 'react';
import {
    StyleSheet,
    ScrollView,
    Text,
    View,
    ImageBackground,
} from 'react-native';
import {
    Button,
    Flex,
    WhiteSpace,
    WingBlank,
    InputItem,
    List,
} from '@ant-design/react-native';
export default class ExChange extends Component {
    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);

        // 设置当前组件的属性
        this.state = {
            value: '',
            number: '',
            //列表
            arr: [
                {
                    xq: '华帝领域',
                    qy: '负一楼',
                    bh: 'C-121',
                    money: '80000',
                    adress: '合川区华帝街华帝领域33号',
                    jm: '35',
                    tn: '25',
                    hd: '五一大促销活动',
                    startime: '2020/5/20 14:00',
                    endtime: '2020/6/20 14:00',
                    fkfs: 1,
                    jrtc: '36期',
                    zptc: '套餐二十',
                    xjq: 80000,
                    carhd: 10,
                    park: 80000,
                },
            ],
        };

        console.disableYellowBox = true;
    }
    render() {
        return (
            <ScrollView
                style={{flex: 1}}
                automaticallyAdjustContentInsets={false}
                showsHorizontalScrollIndicator={false}
                showsVerticalScrollIndicator={false}>
                <WhiteSpace size="xl" />
                {this.state.arr.map((item) => {
                    return (
                        <>
                            <WingBlank style={styles.wingblank}>
                                <Flex justify="between" style={styles.flextext}>
                                    <Text>{item.xq}</Text>
                                    <Text>{item.qy}</Text>
                                    <Text>{item.bh}</Text>
                                    <Text>价格：￥{item.money}</Text>
                                </Flex>
                                <Flex justify="between" style={styles.flextext}>
                                    <Text>住址：{item.adress}</Text>
                                </Flex>
                                <Flex justify="between" style={styles.flextext}>
                                    <Text>
                                        建筑面积：{item.jm}平方米 使用面积：
                                        {item.tn}平方米{' '}
                                    </Text>
                                </Flex>
                                <Flex justify="between" style={styles.flextext}>
                                    <Text>
                                        {item.hd} {item.startime}--
                                        {item.endtime}
                                    </Text>
                                </Flex>
                                <Flex justify="between" style={styles.flextext}>
                                    <Text>
                                        {item.fkfs == 1 ? '0首付' : '全款'}{' '}
                                        {item.jrtc} {item.zptc} {item.xjq}现金券{' '}
                                        {item.carhd}人抽一次汽车 价值{item.park}
                                        车位
                                    </Text>
                                </Flex>
                                <WhiteSpace />
                                <Flex justify="start">
                                    <List
                                        renderHeader={'上传资料'}
                                        style={{width: '100%'}}>
                                        <InputItem
                                            clear
                                            type="number"
                                            value={this.state.number}
                                            onChange={(value) => {
                                                this.setState({
                                                    number: value,
                                                });
                                            }}
                                            placeholder="number"
                                            style={{borderWidth: 0.3}}>
                                            付款金额：
                                        </InputItem>
                                    </List>
                                </Flex>
                                <Flex justify="between">
                                    <Text>请上传付款凭证：</Text>
                                </Flex>
                            </WingBlank>
                        </>
                    );
                })}
                <WhiteSpace size="xl" />
            </ScrollView>
        );
    }
}
const styles = StyleSheet.create({
    wingblank: {
        paddingTop: '2%',
        paddingBottom: '2%',

        paddingLeft: '1%',
        paddingRight: '1%',
        marginBottom: '3%',
    },
    flextext: {
        paddingBottom: '3%',
    },
});
